<!DOCTYPE html>

<html>
<head>
  <title>literal.js</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="..\..\..\docco.css" />
</head>
<body>
  <div id="container">
    <div id="background"></div>
    
    <ul class="sections">
        
          <li id="title">
              <div class="annotation">
                  <h1>literal.js</h1>
              </div>
          </li>
        
        
        
        <li id="section-1">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-1">&#182;</a>
              </div>
              <p>Literal nodes are for plain strings in the regular expression. They are
rendered as labels with the value of the literal quoted.</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>
<span class="hljs-keyword">import</span> _ <span class="hljs-keyword">from</span> <span class="hljs-string">'lodash'</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
  <span class="hljs-attr">type</span>: <span class="hljs-string">'literal'</span>,</pre></div></div>
            
        </li>
        
        
        <li id="section-2">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-2">&#182;</a>
              </div>
              <p>Renders the literal into the currently set container.</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  _render() {
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.renderLabel([<span class="hljs-keyword">this</span>.literal])
      .then(<span class="hljs-function"><span class="hljs-params">label</span> =&gt;</span> {
        <span class="hljs-keyword">let</span> spans = label.selectAll(<span class="hljs-string">'tspan'</span>);

        label.select(<span class="hljs-string">'rect'</span>).attr({
          <span class="hljs-attr">rx</span>: <span class="hljs-number">3</span>,
          <span class="hljs-attr">ry</span>: <span class="hljs-number">3</span>
        });

        <span class="hljs-keyword">return</span> label;
      });
  },</pre></div></div>
            
        </li>
        
        
        <li id="section-3">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-3">&#182;</a>
              </div>
              <p>Merges this literal with another. Literals come back as single characters
during parsing, and must be post-processed into multi-character literals
for rendering. This processing is done in <a href="./match.html">Match</a>.</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>  merge(other) {
    <span class="hljs-keyword">this</span>.literal += other.literal;
  },

  setup() {</pre></div></div>
            
        </li>
        
        
        <li id="section-4">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-4">&#182;</a>
              </div>
              <p>Value of the literal.</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>    <span class="hljs-keyword">this</span>.literal = <span class="hljs-keyword">this</span>.properties.literal.textValue;</pre></div></div>
            
        </li>
        
        
        <li id="section-5">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-5">&#182;</a>
              </div>
              <p>Ordinal value of the literal for use in
<a href="./charset_range.html">CharsetRange</a>.</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>    <span class="hljs-keyword">this</span>.ordinal = <span class="hljs-keyword">this</span>.literal.charCodeAt(<span class="hljs-number">0</span>);
  }
};</pre></div></div>
            
        </li>
        
    </ul>
  </div>
</body>
</html>
